package mutsumimod.cards.custom;

import com.megacrit.cardcrawl.actions.GameActionManager;
import com.megacrit.cardcrawl.actions.utility.DiscardToHandAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.cards.CardGroup;
import com.megacrit.cardcrawl.cards.green.Eviscerate;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.rooms.AbstractRoom;
import mutsumimod.actions.CustomDrawPileToHandAction;
import mutsumimod.cards.BaseCard;
import mutsumimod.character.Mutsumi;
import mutsumimod.monitors.EatMonitor;
import mutsumimod.util.CardStats;

import java.util.ArrayList;
import java.util.Arrays;

public class Eat extends BaseCard {
    public static final String ID = makeID(Eat.class.getSimpleName());
    public static final CardStats info = new CardStats(
            Mutsumi.Meta.CARD_COLOR,
            CardType.ATTACK,
            CardRarity.UNCOMMON,
            CardTarget.ENEMY,
            6
    );

    public Eat() {
        super(ID, info);
        setAttr(14,14,0);
        setAttrUpg(3,3,0);
    }

    @Override
    public void onTriggerStand(int amount) {
        setCostForTurn(this.costForTurn - amount);
    }

    public void triggerWhenDrawn() {
        super.triggerWhenDrawn();
        setCostForTurn(this.cost - EatMonitor.standAmountThisTurn);
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        damageMonster(m);
        gainBlock();
    }

    @Override
    public AbstractCard makeCopy() {
        AbstractCard tmp = new Eat();
        if (CardCrawlGame.dungeon != null && AbstractDungeon.currMapNode != null &&
                (AbstractDungeon.getCurrRoom()).phase == AbstractRoom.RoomPhase.COMBAT) {
            setCostForTurn(this.cost - EatMonitor.standAmountThisTurn);
        }
        return tmp;
    }
}
